package com.floreantpos.model.base;

import java.io.Serializable;

/**
 * This is an object that contains data related to the RESTAURANT table. Do not
 * modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class table="GUEST"
 */
public abstract class BaseGuest implements Comparable, Serializable {

  public static String REF = "Guest";
  public static String PROP_ID = "id";
  public static String PROP_NAME = "name";
  public static String PROP_TELEPHONE = "telephone";
  public static String PROP_ADDRESS_LINE1 = "addressLine1";
  public static String PROP_ADDRESS_LINE2 = "addressLine2";
  public static String PROP_ADDRESS_LINE3 = "addressLine3";
  public static String PROP_CURRENT_BALANCE = "currentBalance";
  public static String PROP_DELIVERY_CHARGE = "deliveryCharge";
  public static String PROP_TAX_ID = "taxId";

  // constructors
  public BaseGuest() {
    initialize();
  }

  /**
   * Constructor for primary key
   */
  public BaseGuest(java.lang.Integer id) {
    this.setId(id);
    initialize();
  }

  /**
   * Constructor for required fields
   */
  public BaseGuest(
          java.lang.Integer id,
          java.lang.String name,
          java.lang.String telephone,
          java.lang.String addressLine1) {

    this.setId(id);
    this.setName(name);
    this.setTelephone(telephone);
    this.setAddressLine1(addressLine1);

    initialize();
  }

  protected void initialize() {
  }

  private int hashCode = Integer.MIN_VALUE;

  // primary key
  private java.lang.Integer id;

  // fields
  private java.lang.String name;
  private java.lang.String telephone;
  private java.lang.String addressLine1;
  private java.lang.String addressLine2;
  private java.lang.String addressLine3;
  private java.lang.Double currentBalance;
  private java.lang.Double deliveryCharge;
  private java.lang.String taxId;

  /**
   * Return the unique identifier of this class
   *
   * @hibernate.id generator-class="assigned" column="ID"
   */
  public java.lang.Integer getId() {
    return id;
  }

  /**
   * Set the unique identifier of this class
   *
   * @param id the new ID
   */
  public void setId(java.lang.Integer id) {
    this.id = id;
    this.hashCode = Integer.MIN_VALUE;
  }

  /**
   * Return the value associated with the column: NAME
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Set the value related to the column: NAME
   *
   * @param name the NAME value
   */
  public void setName(java.lang.String name) {
    this.name = name;
  }

  /**
   * Return the value associated with the column: ADDRESS_LINE1
   */
  public java.lang.String getAddressLine1() {
    return addressLine1;
  }

  /**
   * Set the value related to the column: ADDRESS_LINE1
   *
   * @param addressLine1 the ADDRESS_LINE1 value
   */
  public void setAddressLine1(java.lang.String addressLine1) {
    this.addressLine1 = addressLine1;
  }

  /**
   * Return the value associated with the column: ADDRESS_LINE2
   */
  public java.lang.String getAddressLine2() {
    return addressLine2;
  }

  /**
   * Set the value related to the column: ADDRESS_LINE2
   *
   * @param addressLine2 the ADDRESS_LINE2 value
   */
  public void setAddressLine2(java.lang.String addressLine2) {
    this.addressLine2 = addressLine2;
  }

  /**
   * Return the value associated with the column: ADDRESS_LINE3
   */
  public java.lang.String getAddressLine3() {
    return addressLine3;
  }

  /**
   * Set the value related to the column: ADDRESS_LINE3
   *
   * @param addressLine3 the ADDRESS_LINE3 value
   */
  public void setAddressLine3(java.lang.String addressLine3) {
    this.addressLine3 = addressLine3;
  }

  /**
   * Return the value associated with the column: TELEPHONE
   */
  public java.lang.String getTelephone() {
    return telephone;
  }

  /**
   * Set the value related to the column: TELEPHONE
   *
   * @param telephone the TELEPHONE value
   */
  public void setTelephone(java.lang.String telephone) {
    this.telephone = telephone;
  }
  
  /**
   * Return the value associated with the column: TAX_ID
   */
  public java.lang.String getTaxId() {
    return taxId;
  }

  /**
   * Set the value related to the column: TAX_ID
   *
   * @param taxId the TAX_ID value
   */
  public void setTaxId(java.lang.String taxId) {
    this.taxId = taxId;
  }  

  /**
   * Return the value associated with the column: CURRENT_BALANCE
   */
  public java.lang.Double getCurrentBalance() {
    return currentBalance == null ? 0 : currentBalance;
  }

  /**
   * Set the value related to the column: CURRENT_BALANCE
   *
   * @param currentBalance the CURRENT_BALANCE value
   */
  public void setCurrentBalance(java.lang.Double currentBalance) {
    this.currentBalance = currentBalance;
  }

  /**
   * Return the value associated with the column: DELIVERY_CHARGE
   */
  public java.lang.Double getDeliveryCharge() {
    return deliveryCharge == null ? 0 : deliveryCharge;
  }

  /**
   * Set the value related to the column: DELIVERY_CHARGE
   *
   * @param deliveryCharge the DELIVERY_CHARGE value
   */
  public void setDeliveryCharge(java.lang.Double deliveryCharge) {
    this.deliveryCharge = deliveryCharge;
  }

  public boolean equals(Object obj) {
    if (null == obj) {
      return false;
    }
    if (!(obj instanceof com.floreantpos.model.Guest)) {
      return false;
    } else {
      com.floreantpos.model.Guest guest = (com.floreantpos.model.Guest) obj;
      if (null == this.getId() || null == guest.getId()) {
        return false;
      } else {
        return (this.getId().equals(guest.getId()));
      }
    }
  }

  public int hashCode() {
    if (Integer.MIN_VALUE == this.hashCode) {
      if (null == this.getId()) {
        return super.hashCode();
      } else {
        String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
        this.hashCode = hashStr.hashCode();
      }
    }
    return this.hashCode;
  }

  public int compareTo(Object obj) {
    if (obj.hashCode() > hashCode()) {
      return 1;
    } else if (obj.hashCode() < hashCode()) {
      return -1;
    } else {
      return 0;
    }
  }

  public String toString() {
    return super.toString();
  }

}
